Skip to content

Conversation

@gandhi56
Copy link
Contributor

@gandhi56 gandhi56 commented Jan 29, 2025

Associated PR: #124989

@gandhi56 gandhi56 requested review from AlexVlx and yxsamliu January 29, 2025 20:56
@gandhi56 gandhi56 self-assigned this Jan 29, 2025
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jan 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 29, 2025

@llvm/pr-subscribers-clang

Author: Anshil Gandhi (gandhi56)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/124983.diff

1 Files Affected:

  • (added) clang/test/CodeGenCUDA/increment-index-for-thunks.cu (+33)
diff --git a/clang/test/CodeGenCUDA/increment-index-for-thunks.cu b/clang/test/CodeGenCUDA/increment-index-for-thunks.cu
new file mode 100644
index 00000000000000..65c929ad4ce706
--- /dev/null
+++ b/clang/test/CodeGenCUDA/increment-index-for-thunks.cu
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -fcuda-is-device -triple amdgcn-amd-amdhsa -target-cpu gfx942 \
+// RUN:   -emit-llvm -xhip %s -o - | FileCheck %s
+
+// CHECK: @_ZTV1C = linkonce_odr unnamed_addr addrspace(1) constant { [5 x ptr addrspace(1)], [4 x ptr addrspace(1)] } { [5 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1B2f2Ev to ptr addrspace(1)), ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1C2f1Ev to ptr addrspace(1))], [4 x ptr addrspace(1)] [ptr addrspace(1) inttoptr (i64 -8 to ptr addrspace(1)), ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1C2f1Ev to ptr addrspace(1))] }, comdat, align 8
+// CHECK: @_ZTV1B = linkonce_odr unnamed_addr addrspace(1) constant { [3 x ptr addrspace(1)] } { [3 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @_ZN1B2f2Ev to ptr addrspace(1))] }, comdat, align 8
+// CHECK: @_ZTV1A = linkonce_odr unnamed_addr addrspace(1) constant { [4 x ptr addrspace(1)] } { [4 x ptr addrspace(1)] [ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) null, ptr addrspace(1) addrspacecast (ptr @__cxa_pure_virtual to ptr addrspace(1))] }, comdat, align 8
+// CHECK: @__hip_cuid_ = addrspace(1) global i8 0
+// CHECK: @llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @__hip_cuid_ to ptr)], section "llvm.metadata"
+// CHECK: @__oclc_ABI_version = weak_odr hidden local_unnamed_addr addrspace(4) constant i32 500
+
+struct A {
+  __attribute__((device)) A() { }
+  virtual void neither_device_nor_host_f() = 0 ;
+  __attribute__((device)) virtual void f1() = 0;
+ 
+};
+ 
+struct B {
+  __attribute__((device)) B() { }
+  __attribute__((device)) virtual void f2() { };
+};
+ 
+struct C : public B, public A {
+  __attribute__((device)) C() : B(), A() { }
+ 
+   virtual void neither_device_nor_host_f() override { }
+  __attribute__((device)) virtual void f1() override { }
+ 
+};
+ 
+__attribute__((device)) void test() {
+  C obj;
+}

@AlexVlx
Copy link
Contributor

AlexVlx commented Jan 29, 2025

Could you please add another RUN line for SPIRV? That’d just use the spirv64-amd-amdhsa triple; you will need a different prefix as it has a different AS map.

@gandhi56 gandhi56 changed the title [CUDA] Precommit test for VTable codegen [NFC][Clang] Precommit test for VTable codegen Jan 29, 2025
@gandhi56 gandhi56 requested review from Artem-B and bcahoon January 29, 2025 21:26
@gandhi56
Copy link
Contributor Author

@yxsamliu will you approve this PR since you have approved #124989? Thanks.

@gandhi56 gandhi56 merged commit bf9b72e into llvm:main Feb 20, 2025
7 of 8 checks passed
@gandhi56 gandhi56 deleted the chai/precommit-test branch February 20, 2025 15:47
searlmc1 pushed a commit to ROCm/llvm-project that referenced this pull request Mar 26, 2025
rocm-ci pushed a commit to ROCm/llvm-project that referenced this pull request Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants